其實,我的鐵人賽文章已經夠了。不過就在最後幾天,臉書好友突然丟了一個連結(https://lnmp.org/ )給我,並許願希望見到透過這個工具安裝。由於先前的安裝環境均被我砍了,於是我就仿照 Day06 的內容以 CentOS-7-x86_64-Minimal-1810.iso 執行最小安裝。
仿照 Day06 內容,以 Minimal 進行 CentOS 7 文字模式的基本安裝。
網路採 DHCP 取到的 IP 為 192.168.16.129/24、預設閘道與 DNS 為 192.168.16.2。
安裝 net-tools、bash-completion、screen、wget 套件,前兩者是自己需要,後兩者為等會使用安裝包時需要。
[doraemon@centos7-cli ~]$ sudo yum install net-tools bash-completion screen wget -y
更新現有軟體,然後重開機
[doraemon@centos7-cli ~]$ sudo yum update -y
[doraemon@centos7-cli ~]$ yum sudo yum clean all
[doraemon@centos7-cli ~]$ sudo systemctl reboot
執行 screen 工具
[doraemon@centos7-cli ~]$ screen -S lnmp
下載並且解壓縮
[doraemon@centos7-cli ~]$ wget <http://soft.vpser.net/lnmp/lnmp1.6.tar.gz> -cO lnmp1.6.tar.gz
[doraemon@centos7-cli ~]$ tar zxf lnmp1.6.tar.gz
[doraemon@centos7-cli ~]$ cd lnmp1.6
[doraemon@centos7-cli lnmp1.6]$ sudo ./install.sh lnmpa
選擇安裝資料庫 MySQL 8.0.13
+------------------------------------------------------------------------+
| LNMP V1.6 for CentOS Linux Server, Written by Licess |
+------------------------------------------------------------------------+
| A tool to auto-compile & install LNMP/LNMPA/LAMP on Linux |
+------------------------------------------------------------------------+
| For more information please visit <https://lnmp.org> |
+------------------------------------------------------------------------+
You have 11 options for your DataBase install.
1: Install MySQL 5.1.73
2: Install MySQL 5.5.62 (Default)
3: Install MySQL 5.6.44
4: Install MySQL 5.7.26
5: Install MySQL 8.0.13
6: Install MariaDB 5.5.63
7: Install MariaDB 10.0.38
8: Install MariaDB 10.1.40
9: Install MariaDB 10.2.24
10: Install MariaDB 10.3.15
0: DO NOT Install MySQL/MariaDB
Enter your choice (1, 2, 3, 4, 5, 6, 7, 8, 9, 10 or 0): 5
You will install MySQL 8.0.13
===========================
Please setup root password of MySQL.
Please enter: password
MySQL root password: password
===========================
Do you want to enable or disable the InnoDB Storage Engine?
Default enable,Enter your choice [Y/n]: Y
You will enable the InnoDB Storage Engine
選擇安裝 PHP 7.3.6、選擇不安裝記憶體優化工具
===========================
You have 9 options for your PHP install.
1: Install PHP 5.2.17
2: Install PHP 5.3.29
3: Install PHP 5.4.45
4: Install PHP 5.5.38
5: Install PHP 5.6.40 (Default)
6: Install PHP 7.0.33
7: Install PHP 7.1.30
8: Install PHP 7.2.19
9: Install PHP 7.3.6
Enter your choice (1, 2, 3, 4, 5, 6, 7, 8 or 9): 9
You will install PHP 7.3.6
選擇不安裝記憶體優化工具、輸入管理者 Email
===========================
You have 3 options for your Memory Allocator install.
1: Don't install Memory Allocator. (Default)
2: Install Jemalloc
3: Install TCMalloc
Enter your choice (1, 2 or 3): 1
You will install not install Memory Allocator.
===========================
Please enter Administrator Email Address: admin@lab.example.com
===========================
Server Administrator Email: admin@lab.example.com
===========================
選擇安裝 Apache 2.4.39,接著就開始安裝
===========================
You have 2 options for your Apache install.
1: Install Apache 2.2.34
2: Install Apache 2.4.39 (Default)
Enter your choice (1 or 2): 2
You will install Apache 2.4.39
Press any key to install...or Press Ctrl+c to cancel
經過 33 分鐘的等待,結果如下(按 Ctrl + C 退出):
============================== Check install ==============================
Checking ...
Nginx: OK
MySQL: OK
PHP: OK
Apache: OK
Clean Web Server src directory...
+------------------------------------------------------------------------+
| LNMP V1.6 for CentOS Linux Server, Written by Licess |
+------------------------------------------------------------------------+
| For more information please visit <https://lnmp.org> |
+------------------------------------------------------------------------+
| lnmp status manage: lnmp {start|stop|reload|restart|kill|status} |
+------------------------------------------------------------------------+
| phpMyAdmin: <http://IP/phpmyadmin/> |
| phpinfo: <http://IP/phpinfo.php> |
| Prober: <http://IP/p.php> |
+------------------------------------------------------------------------+
| Add VirtualHost: lnmp vhost add |
+------------------------------------------------------------------------+
| Default directory: /home/wwwroot/default |
+------------------------------------------------------------------------+
| MySQL/MariaDB root password: password |
+------------------------------------------------------------------------+
+-------------------------------------------+
| Manager for LNMP, Written by Licess |
+-------------------------------------------+
| <https://lnmp.org> |
+-------------------------------------------+
nginx (pid 68342) is running...
SUCCESS! MySQL running (68914)
Apache is running.
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 127.0.0.1:88 *:*
LISTEN 0 128 *:80 *:*
LISTEN 0 128 *:80 *:*
LISTEN 0 128 *:80 *:*
LISTEN 0 128 *:80 *:*
LISTEN 0 128 *:22 *:*
LISTEN 0 70 [::]:33060 [::]:*
LISTEN 0 128 [::]:3306 [::]:*
LISTEN 0 128 [::]:22 [::]:*
Install lnmp takes 33 minutes.
Install lnmp V1.6 completed! enjoy it.
^C[doraemon@centos7-cli lnmp1.6]$